package com.wh.utils;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @Auther: HuiEr
 * @Date: 2020/3/11 14:04
 * @Description
 */
public  class ConnectionUtil {
    public static Connection getConnection() throws IOException, TimeoutException {
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("47.99.219.169");
        connectionFactory.setVirtualHost("/");
        connectionFactory.setUsername("xiaobobo");
        connectionFactory.setPassword("12345678");
        connectionFactory.setPort(5672);
        return connectionFactory.newConnection();
    }
}
